{include file="public/header" /}
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>编辑</h5>
                </div>
                <div class="ibox-content layui-form">
                    <div class="layui-row layui-col-space10 layui-form-item ">
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">客户公司：</label>
                            <div class="layui-input-block">
                                <input type="text" class="layui-input" lay-verify="required" value="{$data.s_com_name}" name="s_com_name">
                            </div>
                        </div>
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">联系人：</label>
                            <div class="layui-input-block">
                                <input type="text" class="layui-input" lay-verify="required" value="{$data.s_name}" name="s_name">
                            </div>
                        </div>
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8 form-group">
                            <label class="layui-form-label">等级：</label>
                            <div class="layui-input-block">
                                <input type="radio" name="s_role" value="3" {$data.s_role==3?'checked':''} class="layui-input" title="区域加盟商"/>
                                <input type="radio" name="s_role" value="4" {$data.s_role==4?'checked':''} class="layui-input" title="县级运营商"/>
                                <input type="radio" name="s_role" value="5" {$data.s_role==5?'checked':''} class="layui-input" title="市级分公司"/>
                                <input type="radio" name="s_role" value="6" {$data.s_role==6?'checked':''} class="layui-input" title="省级子公司"/>
                            </div>
                        </div>
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">内部老师：</label>
                            <div class="layui-input-block">
                                <input type="text" class="layui-input" lay-verify="required" value="{$data.s_inside_name}" name="s_inside_name">
                            </div>
                        </div>
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">老师电话：</label>
                            <div class="layui-input-block">
                                <input type="text" class="layui-input" lay-verify="required" maxlength="11" value="{$data.s_inside_phone}" name="s_inside_phone">
                            </div>
                        </div>
                        <div style="clear: both"></div>
                        <div class="ibox-title">
                            <h5>其他设置</h5>
                        </div>
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">年任务量：</label>
                            <div class="layui-input-block">
                                <div class="one flex-wrap underLine">
                                    <input type="text" name="s_year_other" value="{$data.s_year_other}" class="layui-input">
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">保护时间：</label>
                            <div class="layui-input-block">
                                <div class="one flex-wrap underLine">
                                    <input type="text" name="s_time_other" value="{$data.s_time_other}" class="layui-input" onclick="wk.lay_date_day(this);" readonly>
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">是否完成任务：</label>
                            <div class="layui-input-block">
                                是&nbsp;<input type="radio" name="s_done_other" value="是" {if $data.s_done_other == '是'}checked{/if} class="layui-input" />
                                否&nbsp;<input type="radio" name="s_done_other" value="否" {if $data.s_done_other == '否'}checked{/if} class="layui-input" />
                            </div>
                        </div>
                        {if $data['s_status'] == 2}
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">是否区域保护：</label>
                            <div class="layui-input-block">
                                是&nbsp;<input type="radio" name="s_protect" value="1" {if $data.s_protect == 1}checked{/if} class="layui-input" />
                                否&nbsp;<input type="radio" name="s_protect" value="2" {if $data.s_protect == 2}checked{/if} class="layui-input" />
                            </div>
                        </div>
                        {/if}
                        <input type="hidden" value="{$data.s_id}" name="s_id">
                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <div class="layui-input-block">
                                <button class="layui-btn" lay-submit="" lay-filter="component-form-element">提交
                                </button>
                                <!--<button class="layui-btn layui-btn-primary" onclick="wk.layer_close('close')">关闭</button>-->
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{include file="public/footer" /}
</body>
</html>
<script type="text/javascript">
    layui.use(['form','upload','layedit'], function() {
        var form = layui.form;
        form.on('submit(component-form-element)', function (data) {
            $('.layui-btn').addClass('layui-disabled').attr('disabled','disabled');
            $.ajax({
                url:"{:url('update')}",
                type:'post',
                dataType:'json',
                data:data.field,
                success:function(res){
                    if (res.code == 200) {
                        layer.msg(res.msg,{icon:1,time:1500,shade:0.1},function(index){
                            wk.layer_close();
                        })
                    } else {
                        wk.error(res.msg,'','$(".layui-btn").removeClass(\'layui-disabled\').removeAttr(\'disabled\');');
                    }
                }
            })
        });
    });
</script>